Zadig 文档
Zadig
教程
博客
论坛
关于
中文英文
Zadig
教程
博客
论坛
关于
Zadig v4.2
Loading...
     编辑文档
     反馈问题
     社区讨论

    本页导航

    Environment

    # View Environment List

    # Test Environment

    Request

    GET /openapi/environments?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Response Example

    Details
    [
            {
                "env_name": "dev",
                "cluster_id": "0123456789abcdef12345678",   # K8s Cluster ID
                "namespace": "k8s-fansitest-env-dev",       # K8s Namespace
                "production": false,                        # Whether it's a production environment
                "registry_id": "630c7ad700430c131062e245",  # Image Registry ID
                "status": "success",                        # Environment status, including success(normal), failed(failed), creating(creating), updating(updating), deleting(deleting), unknown(unknown), unstable(unstable), sleeping(sleeping)
                "update_by": "admin",                       # Environment updater
                "update_time": 1690186199                   # Last update time, Unix timestamp format
            },
            {
                "env_name": "dev5",
                "cluster_id": "0123456789abcdef12345678",
                "namespace": "ai-test-2-env-dev",
                "production": false,
                "registry_id": "6350be2b4503905e98b4b771",
                "status": "success",
                "update_by": "admin",
                "update_time": 1690181832
            }
    ]
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    # Production Environment

    Request

    GET /openapi/environments/production?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Response Example

    Details
    [
            {
                "env_name": "dev",
                "cluster_id": "0123456789abcdef12345678",   # K8s Cluster ID
                "namespace": "k8s-fansitest-env-dev",       # K8s Namespace
                "production": true,                        # Whether it's a production environment
                "registry_id": "630c7ad700430c131062e245",  # Image Registry ID
                "status": "success",                        # Environment status, including success(normal), failed(failed), creating(creating), updating(updating), deleting(deleting), unknown(unknown), unstable(unstable), sleeping(sleeping)
                "update_by": "admin",                       # Environment updater
                "update_time": 1690186199                   # Last update time, Unix timestamp format
            },
            {
                "env_name": "dev5",
                "cluster_id": "0123456789abcdef12345678",
                "namespace": "ai-test-2-env-dev",
                "production": true,
                "registry_id": "6350be2b4503905e98b4b771",
                "status": "success",
                "update_by": "admin",
                "update_time": 1690181832
            }
    ]
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    # View Environment Details

    Applicable to K8s YAML projects.

    # Test Environment

    Request

    GET /openapi/environments/<environmentKey>?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Response Example

    Details
    {
        "project_key": "simple-demo",              # Project Key
        "env_key": "dev",                          # Environment Key
        "update_by": "admin",                       # Environment updater
        "update_time": 1689933256,                  # Last update time, Unix timestamp format
        "cluster_id": "0123456789abcdef12345678",   # K8s Cluster ID
        "namespace": "simple-demo-env-dev",         # K8s Namespace
        "registry_id": "630c7ad700430c131062e245",  # Image Registry ID
        "global_variables": [                       # Global variables list
            {
                "key": "cpuLimit",                  # Variable key
                "value": "1000m",                   # Variable value
                "type": "string",                   # Variable type, including string, bool, enum, yaml
                "options": [],                      # Variable options, meaningful when type is enum
                "desc": "CPU Resource Limit",       # Variable description
                "related_services": ["service1"]    # Related services
            }
        ],
        "services": [                               # Services list
            {
                "service_name": "service2",         # Service name
                "containers": [                     # Service component information
                    {
                        "name": "myapp-1",          # Service component name
                        "image": "koderover.tencentcloudcr.com/test/myapp-1:20230721164449-6-main", # Service component image
                        "image_name": "myapp-1"     # Service component image name
                    }
                ],
                "variable_kvs": [                   # Service variables list
                    {
                        "key": "env1",
                        "value": "demo",
                        "type": "string",
                    }
                ],
                "status": "running",               # Service status, including running(running), unstable(unstable), unstart(not started), failed(failed), pending(pending), unknown(unknown)
                "type": "k8s"                      # Project type, always k8s
            }
        ],
        "status": "success"                        # Environment status, including creating(creating), updating(updating), deleting(deleting), succeeded(normal), error(internal error), running(running), unstable(unstable), sleeping(sleeping), unknown(unknown)
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41

    # Production Environment

    Request

    GET /openapi/environments/production/<environmentName>?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Response Example

    Details
    {
        "project_key": "simple-demo",              # Project Key
        "env_key": "prod",                         # Environment Key
      	"env_name":"prod",												 # Environment Name
        "update_by": "admin",                       # Environment updater
        "update_time": 1689933256,                  # Last update time, Unix timestamp format
        "cluster_id": "0123456789abcdef12345678",   # K8s Cluster ID
        "namespace": "simple-demo-env-prod",        # K8s Namespace
        "registry_id": "630c7ad700430c131062e245",  # Image Registry ID
        "global_variables": [                       # Global variables list
            {
                "key": "cpuLimit",                  # Variable key
                "value": "1000m",                   # Variable value
                "type": "string",                   # Variable type, including string, bool, enum, yaml
                "options": [],                      # Variable options, meaningful when type is enum
                "desc": "CPU Resource Limit",       # Variable description
                "related_services": ["service1"]    # Related services
            }
        ],
        "services": [                               # Services list
            {
                "service_name": "service2",         # Service name
                "containers": [                     # Service component information
                    {
                        "name": "myapp-1",          # Service component name
                        "image": "koderover.tencentcloudcr.com/test/myapp-1:20230721164449-6-main", # Service component image
                        "image_name": "myapp-1"     # Service component image name
                    }
                ],
                "variable_kvs": [                   # Service variables list
                    {
                        "key": "env1",
                        "value": "demo",
                        "type": "string",
                    }
                ],
                "status": "running",               # Service status, including running(running), unstable(unstable), unstart(not started), failed(failed), pending(pending), unknown(unknown)
                "type": "k8s"                      # Project type, always k8s
            }
        ],
        "status": "success"                        # Environment status, including creating(creating), updating(updating), deleting(deleting), succeeded(normal), error(internal error), running(running), unstable(unstable), sleeping(sleeping), unknown(unknown)
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42

    # View Environment Service Details

    Applicable to K8s YAML projects.

    # Test Environment

    Request

    GET /openapi/environments/<environmentKey>/services/<serviceName>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    workLoadtypeWorkload TypestringYes

    Response Example

    Details
    {
      "service_name": "service1",
      "scales": [
        {
          "name": "service1",
          "type": "Deployment",
          "images": [
            {
              "name": "service1",
              "image": "koderover.tencentcloudcr.com/test/service1:20231214162411",
              "image_name": "service1"
            }
          ],
          "pods": [
            {
              "kind": "ReplicaSet",
              "name": "service1-5b94c8f98f-hsqfl",
              "status": "Running",
              "age": "34d",
              "createtime": 1704444315,
              "ip": "10.200.2.76",
              "labels": {
                "app.kubernetes.io/instance": "service1",
                "app.kubernetes.io/name": "yaml",
                "pod-template-hash": "5b94c8f98f",
                "s-product": "yaml",
                "s-service": "service1"
              },
              "containers": [
                {
                  "name": "service1",
                  "image": "koderover.tencentcloudcr.com/test/service1:20231214162411",
                  "restart_count": 0,
                  "status": "running",
                  "ready": true,
                  "ports": [
                    {
                      "containerPort": 20211,
                      "protocol": "TCP"
                    }
                  ],
                  "message": "",
                  "reason": "",
                  "started_at": 1704444316
                }
              ],
              "node_name": "172.16.0.46",
              "host_ip": "172.16.0.46",
              "enable_debug_container": false,
              "pod_ready": true,
              "containers_ready": true,
              "containers_message": ""
            }
          ],
          "replicas": 1,
          "zadigx_release_type": "",
          "zadigx_release_tag": ""
        }
      ],
      "ingress": [],
      "service_endpoints": [
        {
          "name": "service1",
          "age": "119d",
          "labels": {
            "app.kubernetes.io/instance": "service1",
            "app.kubernetes.io/name": "yaml",
            "s-product": "yaml",
            "s-service": "service1"
          },
          "endpoints": [
            {
              "service_name": "service1",
              "service_port": 20211,
              "node_port": 30593
            }
          ]
        }
      ],
      "cron_jobs": [],
      "namespace": "yaml-env-dev",
      "env_name": "dev",
      "product_name": "yaml",
      "group_name": ""
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85

    # Production Environment

    Request

    GET /openapi/environments/production/<environmentKey>/services/<serviceName>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    workLoadtypeWorkload TypestringYes

    Response Example

    Details
    {
      "service_name": "service1",
      "scales": [
        {
          "name": "service1",
          "type": "Deployment",
          "images": [
            {
              "name": "service1",
              "image": "koderover.tencentcloudcr.com/test/service1:20231214162411",
              "image_name": "service1"
            }
          ],
          "pods": [
            {
              "kind": "ReplicaSet",
              "name": "service1-5b94c8f98f-hsqfl",
              "status": "Running",
              "age": "34d",
              "createtime": 1704444315,
              "ip": "10.200.2.76",
              "labels": {
                "app.kubernetes.io/instance": "service1",
                "app.kubernetes.io/name": "yaml",
                "pod-template-hash": "5b94c8f98f",
                "s-product": "yaml",
                "s-service": "service1"
              },
              "containers": [
                {
                  "name": "service1",
                  "image": "koderover.tencentcloudcr.com/test/service1:20231214162411",
                  "restart_count": 0,
                  "status": "running",
                  "ready": true,
                  "ports": [
                    {
                      "containerPort": 20211,
                      "protocol": "TCP"
                    }
                  ],
                  "message": "",
                  "reason": "",
                  "started_at": 1704444316
                }
              ],
              "node_name": "172.16.0.46",
              "host_ip": "172.16.0.46",
              "enable_debug_container": false,
              "pod_ready": true,
              "containers_ready": true,
              "containers_message": ""
            }
          ],
          "replicas": 1,
          "zadigx_release_type": "",
          "zadigx_release_tag": ""
        }
      ],
      "ingress": [],
      "service_endpoints": [
        {
          "name": "service1",
          "age": "119d",
          "labels": {
            "app.kubernetes.io/instance": "service1",
            "app.kubernetes.io/name": "yaml",
            "s-product": "yaml",
            "s-service": "service1"
          },
          "endpoints": [
            {
              "service_name": "service1",
              "service_port": 20211,
              "node_port": 30593
            }
          ]
        }
      ],
      "cron_jobs": [],
      "namespace": "yaml-env-dev",
      "env_name": "dev",
      "product_name": "yaml",
      "group_name": ""
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85

    # View Environment K8S Service Yaml

    # Test Environment

    Request

    GET /openapi/environments/services/yaml
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    envNameEnvironment NamestringYes
    serviceNameService NamestringYes

    Response Example

    Details
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/instance: service1
        app.kubernetes.io/name: yaml
        env: dev
      name: service1
    spec:
      replicas: 1
      selector:
        matchLabels:
          app.kubernetes.io/instance: service1
          app.kubernetes.io/name: yaml
      strategy: {}
      template:
        metadata:
          creationTimestamp: null
          labels:
            app.kubernetes.io/instance: service1
            app.kubernetes.io/name: yaml
        spec:
          containers:
          - command:
            - /workspace/service1
            image: koderover.tencentcloudcr.com/test/service1:20250722141750-112-main
            imagePullPolicy: Always
            name: service1
            ports:
            - containerPort: 20221
              protocol: TCP
            resources: {}
    status: {}
    
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: service1
      labels:
        app.kubernetes.io/name: yaml
        app.kubernetes.io/instance: service1
    spec:
      type: NodePort
      ports:
        - protocol: TCP
          port: 20221
          targetPort: 20221
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49

    # Production Environment

    Request

    GET /openapi/environments/production/services/yaml
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    envNameEnvironment NamestringYes
    serviceNameService NamestringYes

    Response Example

    Details
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/instance: service1
        app.kubernetes.io/name: yaml
        env: dev
      name: service1
    spec:
      replicas: 1
      selector:
        matchLabels:
          app.kubernetes.io/instance: service1
          app.kubernetes.io/name: yaml
      strategy: {}
      template:
        metadata:
          creationTimestamp: null
          labels:
            app.kubernetes.io/instance: service1
            app.kubernetes.io/name: yaml
        spec:
          containers:
          - command:
            - /workspace/service1
            image: koderover.tencentcloudcr.com/test/service1:20250722141750-112-main
            imagePullPolicy: Always
            name: service1
            ports:
            - containerPort: 20221
              protocol: TCP
            resources: {}
    status: {}
    
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: service1
      labels:
        app.kubernetes.io/name: yaml
        app.kubernetes.io/instance: service1
    spec:
      type: NodePort
      ports:
        - protocol: TCP
          port: 20221
          targetPort: 20221
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50

    # View Environment Helm Service Values

    # Test Environment

    Request

    GET /openapi/environments/service/values
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    envNameEnvironment NamestringYes
    serviceNameService NamestringYes

    Response Example

    Details
    a: b
    c: d
    fullnameOverride: service3
    image:
        repository: koderover.tencentcloudcr.com/test/service3
        tag: 20250711170816-5-lilian01
    imagePullSecretsName: default-registry-secret
    port: 20223
    replicaCount: 4
    resources:
        limits:
            cpu: 20m
            mem: 20Mi
        requests:
            cpu: 10m
            mem: 10Mi
    x: kk
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    # Production Environment

    Request

    GET /openapi/environments/production/service/values
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    envNameEnvironment NamestringYes
    serviceNameService NamestringYes

    Response Example

    Details
    a: b
    c: d
    fullnameOverride: service3
    image:
        repository: koderover.tencentcloudcr.com/test/service3
        tag: 20250711170816-5-lilian01
    imagePullSecretsName: default-registry-secret
    port: 20223
    replicaCount: 4
    resources:
        limits:
            cpu: 20m
            mem: 20Mi
        requests:
            cpu: 10m
            mem: 10Mi
    x: kk
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    # New Environment - K8s YAML Project

    # Test Environment

    Request

    POST /openapi/environments?projectKey=<projectKey>
    
    1

    Body Parameters

    Parameter NameDescriptionTypeRequired
    env_keyEnvironment KeystringYes
    cluster_idK8s Cluster IDstringYes
    namespaceK8s NamespacestringYes
    registry_idImage Registry IDstringYes
    env_configsEnvironment Configurations[]EnvConfigNo
    global_variablesGlobal Variables[]GlobalVariableNo
    servicesServices[]ServiceNo
    sub_envSub Environment[]SubEnvNo

    SubEnv Parameters

    Parameter NameDescriptionTypeRequired
    base_envBase Environment NamestringYes
    enableEnable Sub EnvironmentboolYes

    EnvConfig Parameters

    Parameter NameDescriptionTypeRequired
    yaml_dataEnvironment Configuration YAML ContentstringYes
    common_env_cfg_typeEnvironment Configuration TypestringYes

    GlobalVariable Parameters

    Parameter NameDescriptionTypeRequired
    keyVariable KeystringYes
    valueVariable ValuestringYes

    Service Parameters

    Parameter NameDescriptionTypeRequired
    service_nameService NamestringYes
    typeService TypestringYes
    containersService Images[]ContainerYes
    variable_kvsService Variables[]VariableKVNo

    Container Parameters

    Parameter NameDescriptionTypeRequired
    imageFull Image AddressstringYes
    image_nameImage NamestringYes
    nameService Component NamestringYes

    VariableKV Parameters

    Parameter NameDescriptionTypeRequired
    keyVariable KeystringYes
    valueVariable ValuestringYes
    use_global_variableWhether to Use Global VariableboolYes

    Body Parameter Example

    Details
    {
        "env_key": "dev7",
        "cluster_id": "0123456789abcdef12345678",
        "namespace": "ai-test-2-env-dev",
        "registry_id": "6350be2b4503905e98b4b771",
        "is_public": true,
        "global_variables": [
            {
                "key": "cpuLimit",
                "value": "15m"
            }
        ],
        "services": [
            {
                "service_name": "service2",
                "type": "k8s",
                "containers": [
                    {
                        "image": "koderover.tencentcloudcr.com/test/service2:20230730070002-38-main",
                        "image_name": "service2",
                        "name": "service2"
                    }
                ],
                "variable_kvs": [
                    {
                        "key": "cpu",
                        "value": "8m"
                    },
                    {
                        "key":"cpuLimit",
                        "value":"15m"
                    }
                ]
            }
        ],
        "env_configs": [
            {
                "yaml_data": "apiVersion: v1\ndata:\n  root-cert.pem: |\n    -----BEGIN CERTIFICATE-----\n    MIIC/TCCAeWgAwIBAgIRAISZur/+Sm1i2dv4w5qWhy0wDQYJKoZIhvcNAQELBQAw\n    GDEWMBQGA1UEChMNY2x1c3Rlci5sb2NhbDAeFw0yMjA4MTUwMjM5MTdaFw0zMjA4\n    MTIwMjM5MTdaMBgxFjAUBgNVBAoTDWNsdXN0ZXIubG9jYWwwggEiMA0GCSqGSIb3\n    DQEBAQUAA4IBDwAwggEKAoIBAQDQWPcRpknooTvvR8rg9XOXtOV2XyW2mDCBhQ0E\n    THTQI17l5UK+AkhifJwUeGcc6KsZvBff7ksf5eQ6e1XBkwhEFTn0QBNTQwzVH/gz\n    dVLB/SYgDKZyUBq3N2E0V1tYsrXE/Mc5qRcnBwscAdOcH5gpW3ZxfRUr7t40DY0H\n    Im8RIajIB7UyT9lo+unaPozF5AuIN4ylv6XGcO1voXimCXNg5r2T/ATTA/vqJcS2\n    ZlaT/85+cZCycu8ZwZaVNgxlyjE1CgUBEdMxy0svMXpJvDondEZEPfZVuB1X2FUL\n    fczThsA7XmBvBYKXoKD7cAGlJS1I2nkfxXk+dkN+tolDQA6NAgMBAAGjQjBAMA4G\n    A1UdDwEB/wQEAwICBDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS1JbJ810a/\n    +KEqd78PtqTKRu+iqDANBgkqhkiG9w0BAQsFAAOCAQEAy833M/pdnLkKmZK9NaTp\n    Ten5TQdxhRlPuG3dBfU45VXQ0IhgO7Er0caPagMaVPkqdfuUcd5sT5lfEiJUtt3B\n    bOhyPK09GkD7muhO7Bx1o+qAPXkCjf0JRcAgQcpZ5va72V6bB8CJ5+6YoQV4eQGa\n    mF80vbzPx3zR6At+3JAZaMhbXItBWJi5ULIGMaJ3JRUvqBMG1jsZdeqOa/fTjVc1\n    6gdX/O9eZjfRdnUiBv4kCD00nr74crXfvAmQGDX/EbNqYGLNHqAdqRgibUYowvEC\n    9gaZfvKU4lOaWYnwE4RlJ1Q6uhVgH45fFiq8pAeflSh56TLbjRfi/VM2lg3GN+cm\n    6g==\n    -----END CERTIFICATE-----\nkind: ConfigMap\nmetadata:\n  creationTimestamp: \"2023-07-06T08:01:16Z\"\n  labels:\n    istio.io/config: \"true\"\n  name: istio-ca-root-cert-test\n  namespace: ai-test-2-env-dev\n  selfLink: /api/v1/namespaces/ai-test-2-env-dev/configmaps/istio-ca-root-cert\n  uid: 767723b1-8bb2-4c51-92fd-d224bf0c0dc5\n",
                "common_env_cfg_type": "ConfigMap"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Environment

    Request

    POST /openapi/environments/production?projectKey=<projectKey>
    
    1

    Body Parameters

    Parameter NameDescriptionTypeRequired
    env_keyEnvironment KeystringYes
    env_nameEnvironment NamestringNo
    cluster_idK8s Cluster IDstringYes
    namespaceK8s NamespacestringYes
    registry_idImage Registry IDstringYes
    sub_envSub Environment[]SubEnvNo

    SubEnv Parameters

    Parameter NameDescriptionTypeRequired
    base_envBase Environment NamestringYes
    enableEnable Sub EnvironmentboolYes

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Edit Environment

    Applicable to K8s YAML projects.

    # Test Environment

    Request

    PUT /openapi/environments/<environmentKey>?projectKey=<projectKey>
    
    1

    Body Parameters

    Parameter NameDescriptionTypeRequired
    registry_idImage Registry IDstringYes

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Environment

    Request

    PUT /openapi/environments/production/<environmentKey>?projectKey=<projectKey>
    
    1

    Body Parameters

    Parameter NameDescriptionTypeRequired
    registry_idImage Registry IDstringNo
    env_nameEnvironment NamestringNo

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Delete Environment

    Applicable to K8s YAML projects.

    # Test Environment

    Request

    DELETE /openapi/environments/<environmentKey>?projectKey=<projectKey>&isDelete=true
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    isDeleteWhether to delete the corresponding K8s namespace and servicesboolYes

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Environment

    Request

    DELETE /openapi/environments/production/<environmentKey>?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Add Service - K8s YAML Project

    # Test Environment

    Request

    POST /openapi/environments/service/yaml?projectKey=<projectKey>
    
    1

    Body Parameters

    Parameter NameDescriptionTypeRequired
    env_keyEnvironment KeystringYes
    service_listServices to Add to Environment[]ServiceYes

    Service Parameters

    Parameter NameDescriptionTypeRequired
    service_nameService NamestringYes
    variable_kvsService Variables[]VariableKVNo

    Body Parameter Example

    Details
    {
      "env_key": "dev",
      "service_list": [
        {
          "service_name": "service2",
          "variable_kvs": [
            {
              "key": "cpuLimit",
              "use_global_variable":true
            },
            {
              "key": "port",
              "value": "20221"
            }
          ]
        }
      ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Environment

    Request

    POST /openapi/environments/production/service/yaml?projectKey=<projectKey>
    
    1

    Body Parameters

    Parameter NameDescriptionTypeRequired
    env_keyEnvironment KeystringYes
    service_listServices to Add to Environment[]ServiceYes

    Service Parameters

    Parameter NameDescriptionTypeRequired
    service_nameService NamestringYes
    variable_kvsService Variables[]VariableKVNo

    VariableKV Parameters

    Parameter NameDescriptionTypeRequired
    keyVariable KeystringYes
    valueVariable ValuestringYes
    use_global_variableWhether to Use Global VariableboolYes

    Body Parameter Example

    Details
    {
      "env_key": "dev",
      "service_list": [
        {
          "service_name": "service2",
          "variable_kvs": [
            {
              "key": "cpuLimit",
              "use_global_variable":true
            },
            {
              "key": "port",
              "value": "20221"
            }
          ]
        }
      ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Update Service

    Applicable to K8s YAML projects.

    # Test Environment

    Request

    PUT /openapi/environments/<environmentKey>/services?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Body Parameters

    Parameter NameDescriptionTypeRequired
    service_listService Variables[]ServiceYes

    Service Parameters

    Parameter NameDescriptionTypeRequired
    service_nameService NamestringYes
    variable_kvsService Variables[]VariableKVNo

    Body Parameter Example

    Details
    {
        "service_list": [
        {
          "service_name": "service2",
          "variable_kvs": [
            {
              "key": "cpu",
              "value": "4m",
              "use_global_variable":true
            }
          ]
        }
      ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Environment

    Request

    PUT /openapi/environments/production/<environmentKey>/services?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Body Parameters

    Parameter NameDescriptionTypeRequired
    service_listService Variables[]ServiceYes

    Service Parameters

    Parameter NameDescriptionTypeRequired
    service_nameService NamestringYes
    variable_kvsService Variables[]VariableKVNo

    Body Parameter Example

    Details
    {
        "service_list": [
        {
          "service_name": "service2",
          "variable_kvs": [
            {
              "key": "cpu",
              "value": "4m",
              "use_global_variable":true
            }
          ]
        }
      ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Delete Service

    Applicable to K8s YAML projects.

    # Test Environment

    Request

    DELETE /openapi/environments/service/yaml?projectKey=<projectKey>
    
    1

    Body Parameters

    Parameter NameDescriptionTypeRequired
    env_keyEnvironment KeystringYes
    service_namesServices to Delete[]stringYes
    not_delete_resourceWhether to not Delete K8S ResourcesboolNo

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Environment

    Request

    DELETE /openapi/environments/production/service/yaml?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Body Parameters

    Parameter NameDescriptionTypeRequired
    env_keyEnvironment KeystringYes
    service_namesServices to Delete[]stringYes
    not_delete_resourceWhether to not Delete K8S ResourcesboolNo

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # View Global Variables

    Applicable to K8s YAML projects.

    # Test Environment

    Request

    GET /openapi/environments/<environmentKey>/variable?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Response Example

    Details
    [
        {
            "key": "cpuLimit",                           # Global variable key
            "value": "1000m",                            # Global variable value
            "type": "string",                            # Global variable type, including string, bool, yaml, enum
            "options": [],                               # Variable options, meaningful when type is enum
            "desc": "CPU Limit",                         # Global variable description
            "related_services": ["service1", "service2"] # Related services
        }
    ]
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    # Production Environment

    Request

    GET /openapi/environments/production/<environmentKey>/variable?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Response Example

    Details
    [
        {
            "key": "cpuLimit",                           # Global variable key
            "value": "1000m",                            # Global variable value
            "type": "string",                            # Global variable type, including string, bool, yaml, enum
            "options": [],                               # Variable options, meaningful when type is enum
            "desc": "CPU Limit",                         # Global variable description
            "related_services": ["service1", "service2"] # Related services
        }
    ]
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    # Update Global Variables

    Tip

    1. Applicable to K8s YAML projects.
    2. After updating global variables, related services will be updated synchronously.

    # Test Environment

    Request

    PUT /openapi/environments/<environmentKey>/variable?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Body Parameters

    Parameter NameDescriptionTypeRequired
    global_variablesGlobal Variables to Update[]VariableKVYes

    VariableKV Parameters

    Parameter NameDescriptionTypeRequired
    keyVariable KeystringYes
    valueVariable ValuestringYes

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Environment

    Request

    PUT /openapi/environments/production/<environmentKey>/variable?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Body Parameters

    Parameter NameDescriptionTypeRequired
    global_variablesGlobal Variables to Update[]VariableKVYes

    VariableKV Parameters

    Parameter NameDescriptionTypeRequired
    keyVariable KeystringYes
    valueVariable ValuestringYes

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Add Environment Configuration

    Applicable to K8s YAML projects.

    # Test Environment

    Request

    POST /openapi/environments/<environmentKey>/envcfgs?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Body Parameters

    Parameter NameDescriptionTypeRequired
    nameEnvironment Configuration NamestringYes
    common_env_cfg_typeEnvironment Configuration TypestringYes
    yaml_dataEnvironment Configuration ContentstringYes

    Body Example

    Details
    {
        "name": "game-demo",
        "common_env_cfg_type": "ConfigMap",
        "yaml_data": "apiVersion: v1\ndata:\n  root-cert.pem: |\n    -----BEGIN CERTIFICATE-----\n    MIIC/TCCAeWgAwIBAgIRAISZur/+Sm1i2dv4w5qWhy0wDQYJKoZIhvcNAQELBQAw\n    GDEWMBQGA1UEChMNY2x1c3Rlci5sb2NhbDAeFw0yMjA4MTUwMjM5MTdaFw0zMjA4\n    MTIwMjM5MTdaMBgxFjAUBgNVBAoTDWNsdXN0ZXIubG9jYWwwggEiMA0GCSqGSIb3\n    DQEBAQUAA4IBDwAwggEKAoIBAQDQWPcRpknooTvvR8rg9XOXtOV2XyW2mDCBhQ0E\n    THTQI17l5UK+AkhifJwUeGcc6KsZvBff7ksf5eQ6e1XBkwhEFTn0QBNTQwzVH/gz\n    dVLB/SYgDKZyUBq3N2E0V1tYsrXE/Mc5qRcnBwscAdOcH5gpW3ZxfRUr7t40DY0H\n    Im8RIajIB7UyT9lo+unaPozF5AuIN4ylv6XGcO1voXimCXNg5r2T/ATTA/vqJcS2\n    ZlaT/85+cZCycu8ZwZaVNgxlyjE1CgUBEdMxy0svMXpJvDondEZEPfZVuB1X2FUL\n    fczThsA7XmBvBYKXoKD7cAGlJS1I2nkfxXk+dkN+tolDQA6NAgMBAAGjQjBAMA4G\n    A1UdDwEB/wQEAwICBDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS1JbJ810a/\n    +KEqd78PtqTKRu+iqDANBgkqhkiG9w0BAQsFAAOCAQEAy833M/pdnLkKmZK9NaTp\n    Ten5TQdxhRlPuG3dBfU45VXQ0IhgO7Er0caPagMaVPkqdfuUcd5sT5lfEiJUtt3B\n    bOhyPK09GkD7muhO7Bx1o+qAPXkCjf0JRcAgQcpZ5va72V6bB8CJ5+6YoQV4eQGa\n    mF80vbzPx3zR6At+3JAZaMhbXItBWJi5ULIGMaJ3JRUvqBMG1jsZdeqOa/fTjVc1\n    6gdX/O9eZjfRdnUiBv4kCD00nr74crXfvAmQGDX/EbNqYGLNHqAdqRgibUYowvEC\n    9gaZfvKU4lOaWYnwE4RlJ1Q6uhVgH45fFiq8pAeflSh56TLbjRfi/VM2lg3GN+cm\n    6g==\n    -----END CERTIFICATE-----\nkind: ConfigMap\nmetadata:\n  creationTimestamp: \"2023-07-06T08:01:16Z\"\n  labels:\n    istio.io/config: \"true\"\n  name: istio-ca-root-cert-test\n  namespace: ai-test-2-env-dev\n  selfLink: /api/v1/namespaces/ai-test-2-env-dev/configmaps/istio-ca-root-cert\n  uid: 767723b1-8bb2-4c51-92fd-d224bf0c0dc5\n",
                "common_env_cfg_type": "ConfigMap"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Environment

    Request

    POST /openapi/environments/production/<environmentKey>/envcfgs?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Body Parameters

    Parameter NameDescriptionTypeRequired
    nameEnvironment Configuration NamestringYes
    common_env_cfg_typeEnvironment Configuration TypestringYes
    yaml_dataEnvironment Configuration ContentstringYes

    Body Example

    Details
    {
        "name": "game-demo",
        "common_env_cfg_type": "ConfigMap",
        "yaml_data": "apiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: game-demo\ndata:\n  player_initial_lives: \"3\"\n  ui_properties_file_name: \"user-interface.properties\"\n\n  game.properties: |\n    enemy.types=aliens,monsters\n    player.maximum-lives=25    \n  user-interface.properties: |\n    color.good=purple\n    color.bad=yellow\n    allow.textmode=true    "
    }
    
    1
    2
    3
    4
    5

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # View Environment Configuration List

    Applicable to K8s YAML projects.

    # Test Environment

    Request

    GET /openapi/environments/<environmentKey>/envcfgs?projectKey=<projectKey>&type=<environment configuration type>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    typeEnvironment Configuration TypestringYes

    Response Example

    Details
    [
        {
            "name": "game-demo",                # Environment configuration name
            "env_name": "dev",                  # Environment name
            "project_name": "simple-demo",      # Project key
            "common_env_cfg_type": "ConfigMap", # Environment configuration type
        },
        {
            "name": "istio-ca-root-cert",
            "env_name": "dev",
            "project_name": "simple-demo",
            "common_env_cfg_type": "ConfigMap",
            "update_time": 1687259964
        }
    ]
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    # Production Environment

    Request

    GET /openapi/environments/production/<environmentKey>/envcfgs?projectKey=<projectKey>&type=<environment configuration type>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    typeEnvironment Configuration TypestringYes

    Response Example

    Details
    [
        {
            "name": "game-demo",                # Environment configuration name
            "env_name": "dev",                  # Environment name
            "project_name": "simple-demo",      # Project key
            "common_env_cfg_type": "ConfigMap", # Environment configuration type
        },
        {
            "name": "istio-ca-root-cert",
            "env_name": "dev",
            "project_name": "simple-demo",
            "common_env_cfg_type": "ConfigMap",
            "update_time": 1687259964
        }
    ]
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    # View Environment Configuration Details

    Applicable to K8s YAML projects.

    # Test Environment

    Request

    GET /openapi/environments/<environmentKey>/envcfg/<environment configuration name>?projectKey=<projectKey>&type=<environment configuration type>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    typeEnvironment Configuration TypestringYes

    Response Example

    Manually entered environment configuration example
    {
       "configMap_detail": { // configMap environment configuration resource details, for other resource types the key here is: ingress_detail, secret_detail, pvc_detail
          "name": "istio-ca-root-cert",          # Environment configuration name
          "common_env_cfg_type": "ConfigMap",    # Environment configuration type
          "created_time": 1686225615,            # Environment configuration creation time, Unix timestamp format
          "env_key": "dev",                      # Environment key
          "product_key": "simple-demo",         # Project key
          "yaml_data": ".......",                # Environment configuration YAML content, string format
          "source_detail": {                     # Code repository configuration, this field has information when environment configuration is imported from code repository
              "git_repo_config": {
                  "codehost_key": "kr-test",     # Code source key
                  "namespace": "kr-test-org1",   # Organization name/username
                  "owner": "kr-test-org1",       # Code repository owner
                  "repo": "config-data",         # Code repository
                  "branch": "main",              # Code branch
              },
              "load_path": "cm.yaml",            # File path
              "auto_sync": true                  # Auto sync switch
          }
    	}
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21

    # Production Environment

    Request

    GET /openapi/environments/production/<environmentKey>/envcfg/<environment configuration name>?projectKey=<projectKey>&type=<environment configuration type>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    typeEnvironment Configuration TypestringYes

    Response Example

    Manually entered environment configuration example
    {
      "configMap_detail": { // configMap environment configuration resource details, for other resource types the key here is: ingress_detail, secret_detail, pvc_detail
          "name": "istio-ca-root-cert",          # Environment configuration name
          "common_env_cfg_type": "ConfigMap",    # Environment configuration type
          "created_time": 1686225615,            # Environment configuration creation time, Unix timestamp format
          "env_key": "dev",                      # Environment key
          "product_key": "simple-demo",          # Project key
          "yaml_data": ".......",                # Environment configuration YAML content, string format
          "source_detail": {                     # Code repository configuration, this field has information when environment configuration is imported from code repository
              "git_repo_config": {
                  "codehost_key": "kr-test",     # Code source key
                  "namespace": "kr-test-org1",   # Organization name/username
                  "owner": "kr-test-org1",       # Code repository owner
                  "repo": "config-data",         # Code repository
                  "branch": "main",              # Code branch
              },
              "load_path": "cm.yaml",            # File path
              "auto_sync": true                  # Auto sync switch
          }
    	}
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21

    # Update Environment Configuration

    Applicable to K8s YAML projects.

    Request

    PUT /openapi/environments/envcfgs?projectKey=<projectKey>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Body Parameters

    Parameter NameDescriptionTypeRequired
    nameEnvironment Configuration NamestringYes
    env_keyEnvironment KeystringYes
    common_env_cfg_typeEnvironment Configuration TypestringYes
    yaml_dataEnvironment Configuration ContentstringYes

    Body Parameter Example

    Details
    {
        "name":"game-demo",
        "env_key":"dev",
        "common_env_cfg_type":"ConfigMap",
        "yaml_data": "apiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: game-demo\ndata:\n  player_initial_lives: \"3\"\n  ui_properties_file_name: \"user-interface.properties\"\n\n  game.properties: |\n    enemy.types=aliens,monsters\n    player.maximum-lives=25    \n  user-interface.properties: |\n    color.good=purple\n    color.bad=yellow\n    allow.textmode=true    "
    }
    
    1
    2
    3
    4
    5
    6

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Delete Environment Configuration

    Applicable to K8s YAML projects.

    # Test Environment

    # Request

    DELETE /openapi/environments/<environmentKey>/envcfg/<environment configuration name>?projectKey=<projectKey>&type=<environment configuration type>
    
    1

    # Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    typeEnvironment Configuration TypestringYes

    # Response

    {
      "message": 200
    }
    
    1
    2
    3

    # Production Environment

    # Request

    DELETE /openapi/environments/production/<environmentKey>/envcfg/<environment configuration name>?projectKey=<projectKey>&type=<environment configuration type>
    
    1

    # Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    typeEnvironment Configuration TypestringYes

    # Response

    {
      "message": 200
    }
    
    1
    2
    3

    # Adjust Service Instance Replica Count

    # Request

    POST /openapi/environments/scale
    
    1

    # Body Parameters

    Parameter NameDescriptionTypeRequired
    project_keyProject KeystringYes
    env_keyEnvironment NamestringYes
    workload_nameService Instance NamestringYes
    workload_typeService Instance TypestringYes
    target_replicasTarget Replica CountintYes

    # Body Parameter Example

    Adjust the microservice-demo project, set the backend service replica count to 3 in the dev environment:

    {
        "project_key": "microservice-demo",
        "env_key": "dev",
        "workload_name": "backend",
        "workload_type": "Deployment",
        "target_replicas": 3
    }
    
    1
    2
    3
    4
    5
    6
    7

    # Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Restart Service Instance

    # Test Environment

    # Request

    POST /openapi/environments/<environmentKey>/service/<serviceName>/restart?projectKey=<projectKey>
    
    1

    # Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Environment

    # Request

    POST /openapi/environments/production/<environmentKey>/service/<serviceName>/restart?projectKey=<projectKey>
    
    1

    # Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Update Image

    # Update Deployment Image

    # Request

    POST /openapi/environments/image/deployment/<environmentKey>
    
    1

    # Body Parameters

    Parameter NameDescriptionTypeRequired
    product_nameProject KeystringYes
    env_nameEnvironment NamestringYes
    service_nameService NamestringYes
    nameDeployment NamestringYes
    container_nameContainer NamestringYes
    imageImagestringYes

    # Body Parameter Example

    {
        "product_name":"patrick-dev1-k8s-1",
        "service_name":"service1",
        "container_name":"service1",
        "name":"service1",
        "image":"koderover.tencentcloudcr.com/test/service1:20231116105254-6-main",
        "env_name":"dev2"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8

    # Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Update Statefulset Image

    # Request

    POST /openapi/environments/image/statefulset/<environmentKey>
    
    1

    # Body Parameters

    Parameter NameDescriptionTypeRequired
    product_nameProject KeystringYes
    env_nameEnvironment NamestringYes
    service_nameService NamestringYes
    nameDeployment NamestringYes
    container_nameContainer NamestringYes
    imageImagestringYes

    # Body Parameter Example

    {
        "product_name":"patrick-dev1-k8s-1",
        "service_name":"service1",
        "container_name":"service1",
        "name":"service1",
        "image":"koderover.tencentcloudcr.com/test/service1:20231116105254-6-main",
        "env_name":"dev2"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8

    # Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Update Cronjob Image

    # Request

    POST /openapi/environments/image/cronjob/<environmentKey>
    
    1

    # Body Parameters

    Parameter NameDescriptionTypeRequired
    product_nameProject KeystringYes
    env_nameEnvironment NamestringYes
    service_nameService NamestringYes
    nameDeployment NamestringYes
    container_nameContainer NamestringYes
    imageImagestringYes

    # Body Parameter Example

    {
        "product_name":"patrick-dev1-k8s-1",
        "service_name":"service1",
        "container_name":"service1",
        "name":"service1",
        "image":"koderover.tencentcloudcr.com/test/service1:20231116105254-6-main",
        "env_name":"dev2"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8

    # Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # List Events

    # Request

    GET /openapi/environments/kube/events
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    envNameEnvironment NamestringYes
    nameinvolvedObject NamestringYes
    typeinvolvedObject TypestringYes

    # Response

    Details
    {
      [
        {
            "reason": "ScalingReplicaSet",
            "message": "Scaled up replica set service1-7cc994479d to 1",
            "first_seen": 1707396095,
            "last_seen": 1707396095,
            "count": 1,
            "type": "Normal"
        },
        {
            "reason": "ScalingReplicaSet",
            "message": "Scaled down replica set service1-67455dd499 to 0",
            "first_seen": 1707396102,
            "last_seen": 1707396102,
            "count": 1,
            "type": "Normal"
        }
      ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    # Sub Environment

    # Check Workload's K8S Service

    # Request

    GET /openapi/environments/<environmentKey>/check/workloads/k8sservices
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    # Response

    Details
    ["service2.Deployment","service1.Deployment"]
    
    1

    # Enable Sub Environment

    # Request

    POST /openapi/environments/<environmentKey>/share/enable
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    # Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Disable Sub Environment

    # Request

    DELETE /openapi/environments/<environmentKey>/share/enable
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    # Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Check Sub Environment Ready

    # Request

    GET /openapi/environments/:name/check/sharenv/:op/ready
    
    1

    Path Parameters

    Parameter NameTypeDescriptionRequiredDefault Value
    namestringEnvironment NameYesNone
    opstringOperation TypeYesNone

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    # Response

    Details
    {
      "is_ready": true,
      "checks": {
        "namespace_has_istio_label": false,
        "virtualservice_deployed": false,
        "pods_have_istio_proxy": false,
        "workloads_ready": true,
        "workloads_have_k8s_service": true
      }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    # Get Entry Service

    # Request

    GET /openapi/environments/:name/share/portal/:serviceName
    
    1

    Path Parameters

    Parameter NameTypeDescriptionRequiredDefault Value
    namestringEnvironment NameYesNone
    serviceNamestringService NameYesNone

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Response

    Details
    {
      "default_gateway_address": "81.69.166.47",
      "servers": [
        {
          "host": "zcms-a-b1.8slan.com",
          "port_number": 80,
          "port_protocol": "HTTP"
        },
        {
          "host": "a.zicemoshi-helm-env-dev",
          "port_number": 80,
          "port_protocol": "HTTP"
        }
      ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    # Set Entry Service

    # Request

    POST /openapi/environments/:name/share/portal/:serviceName
    
    1

    Path Parameters

    Parameter NameTypeDescriptionRequiredDefault Value
    namestringEnvironment NameYesNone
    serviceNamestringService NameYesNone

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes

    Body Parameters

    TypeRequired
    []OpenAPISetPortalServiceRequestYes

    OpenAPISetPortalServiceRequest Parameters

    Parameter NameDescriptionTypeRequired
    hostDefault gateway address, possibly ip or domain namestringYes
    port_numberPort numberuint32Yes
    port_protocolPort protocolstringYes

    Body Example

    Details
    [
      {
        "host": "zcms-a-b1.8slan.com",
        "port_number": 80,
        "port_protocol": "HTTP"
      },
      {
        "host": "a.zicemoshi-helm-env-dev",
        "port_number": 80,
        "port_protocol": "HTTP"
      }
    ]
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # View Container Real-Time Logs

    Request

    GET /openapi/logs/sse/pods/<pod name>/containers/<container name>
    
    1

    Query Parameters

    Parameter NameDescriptionTypeRequired
    projectKeyProject KeystringYes
    envNameEnvironment NamestringYes
    tailsLog tail line countstringYes

    Response Example

    Details

    This interface returns an SSE stream, and the returned data format is as follows:

    "log message"
    
    1

    # New Environment - Helm Chart Project

    Request

    POST /openapi/environments/helm?projectKey=<projectKey>
    
    1

    Body Parameters

    Parameter NameDescriptionTypeRequired
    env_nameEnvironment KeystringYes
    aliasEnvironment NamestringNo
    cluster_idK8s Cluster IDstringYes
    namespaceK8s NamespacestringYes
    registry_idImage Registry IDstringYes
    project_keyProject KeystringYes
    productionIs Production EnvironmentboolNo
    sub_envSub Environment[]SubEnvNo

    SubEnv Parameters

    Parameter NameDescriptionTypeRequired
    base_envBase Environment NamestringYes
    enableEnable Sub EnvironmentboolYes

    Body Example

    Details
    {
        "alias": "dev3-api",
        "cluster_id": "0123456789abcdef12345678",
        "env_name": "dev3",
        "namespace": "zicemoshi-env-dev3",
        "production": false,
        "project_key": "zicemoshi",
        "registry_id": "683047fe458904519c5f5c80",
        "sub_env": {
            "base_env": "dev",
            "enable": true
        }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Add Service - Helm Chart Project

    Request

    POST /openapi/environments/helm/<environment name>/services?projectKey=<projectKey>
    
    1

    Body Parameters

    Parameter NameDescriptionTypeRequired
    env_nameEnvironment KeystringYes
    productionIs Production EnvironmentboolNo
    servicesHelm Services[]HelmServiceYes

    HelmService Parameters

    Parameter NameDescriptionTypeRequired
    service_nameService NamestringYes
    deploy_strategyDeployment Strategy, supports import and deploystringYes
    values_yamlValues YAML ContentstringNo
    override_kvsOverride KV Variable List[]OverrideKVNo
    import_values_from_gitImport Values Configuration from GitImportValuesFromGitNo

    OverrideKV Parameters

    Parameter NameDescriptionTypeRequired
    keyKeystringYes
    valueValueanyYes

    ImportValuesFromGit Parameters

    Parameter NameDescriptionTypeRequired
    codehost_nameCode Source NamestringYes
    namespaceNamespacestringYes
    repoRepository NamestringYes
    branchBranch NamestringYes
    value_pathValues File PathstringYes
    auto_syncAuto SyncboolNo

    Body Example

    Details
    {
        "env_name": "api",
        "production": false,
        "services": [
            {
                "deploy_strategy": "deploy",
                "import_values_from_git": {
                    "auto_sync": true,
                    "branch": "patrick-01",
                    "codehost_name": "gitlab",
                    "namespace": "kr-test-org1",
                    "repo": "multi-service-demo",
                    "value_path": "var.yaml"
                },
                "override_kvs": [
                    {
                        "key": "a",
                        "value": "b"
                    }
                ],
                "service_name": "service1",
                "values_yaml": "aa: bb\ncc: dd"
            },
            {
                "deploy_strategy": "import",
                "override_kvs": [
                    {
                        "key": "aa",
                        "value": "bb"
                    }
                ],
                "service_name": "service2",
                "values_yaml": "abc: 123\ndef: 456"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    ← WorkflowService→

    资源
    教程
    论坛
    博客
    公司
    关于
    客户故事
    加入我们
    联系我们
    微信扫一扫
    hello@koderover.com

    © 2026 筑栈(上海)信息技术有限公司 沪 ICP 备 19000177 号 - 1

    •  跟随系统
    •  浅色模式
    •  深色模式
    •  阅读模式